/*----------------------------------------------------------------------------*/
/* Copyright (c) FIRST 2008. All Rights Reserved.							  */
/* Open Source Software - may be modified and shared by FRC teams. The code   */
/* must be accompanied by the FIRST BSD license file in $(WIND_BASE)/WPILib.  */
/*----------------------------------------------------------------------------*/
#include "scaler.hpp"


 


/*
 * 
 * 
 * 
 * 
 * 
 */
 


	
   
	scaler::scaler(float IStep) 
	
	{
		speed = 0 ;
		step = IStep ; 
	}
	

	 
	void scaler::GetSpeed(float & yDrive)
	{
		
		if (yDrive > speed)
			speed +=  step;
		else if (yDrive < speed)
					speed -=  step;	
		
		if (speed>1)speed=1; 
		
		if (speed<-1)speed=-1; 
		
		yDrive=speed;
	}
	
	void scaler::SetStep(float inSpeed)
	{
		step = inSpeed ;
		
		
	}
		
